using System;
using System.Globalization;
using Avalonia;
using Avalonia.Data.Converters;


namespace memdb_demo.Converters{

    public class BuySellFlagConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value==null || !(value is char)){
                //LOGGER
                return AvaloniaProperty.UnsetValue;
            }
            switch((char)value){
                case 'b':return "买";
                case 's':return "卖";
                default:return AvaloniaProperty.UnsetValue;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

